var chalk = require('chalk');

const pluginName = 'DistEndPlugin';

class DistEndPlugin {
    apply(compiler) {
        //生成资源到 output 目录之前
        compiler.hooks.afterEmit.tapAsync(
            pluginName,
            (compilation, callback) => {
                console.log(chalk.green(`执行--->${pluginName}`))
                callback();
            }
        );
    }
}

module.exports = DistEndPlugin;